package com.zys.el.time.fegin;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import com.zys.el.time.entity.User;
import com.zys.el.time.fegin.api.UserApi;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Component
public class UserClient {
    @Resource
    private UserApi userApi;

    public Map<Long, User> getUserListByBatchId(List<Long> ids){
        String userMapJson = (String) userApi.getUserListByBatchId(ids).getModel();
        return JSON.parseObject(userMapJson, new TypeReference<Map<Long, User>>(){});
    }
}
